import request from '@/utils/request'

// 查询archiveBorrow列表
export function listArchiveBorrow(query) {
  return request({
    url: '/archive/archiveBorrow/list',
    method: 'get',
    params: query
  })
}

// 查询archiveBorrow详细
export function getArchiveBorrow(borrowId) {
  return request({
    url: '/archive/archiveBorrow/' + borrowId,
    method: 'get'
  })
}

// 新增archiveBorrow
export function addArchiveBorrow(data) {
  return request({
    url: '/archive/archiveBorrow',
    method: 'post',
    data: data
  })
}

// 修改archiveBorrow
export function updateArchiveBorrow(data) {
  return request({
    url: '/archive/archiveBorrow',
    method: 'put',
    data: data
  })
}

export function updateArchiveBorrowDays(data) {
  return request({
    url: '/archive/archiveBorrow/reSubmitArchiveBorrow',
    method: 'put',
    data: data
  })
}

// 删除archiveBorrow
export function delArchiveBorrow(borrowId) {
  return request({
    url: '/archive/archiveBorrow/' + borrowId,
    method: 'delete'
  })
}


//获取人员树接口
export function deptUserTree(query) {
  return request({
    url: '/system/user/deptUserTreeNoDateScope',
    method: 'GET',
    params: query
  })
}



export function cancelProcess(data) {
  return request({
    url: '/archive/archiveBorrow/handleCancelProcess',
    method: 'put',
    data: data
  })
}

export function downloadWaxPaperDocx(data) {
  return request({
    url: '/archive/archiveBorrow/downloadWaxPaperDocx',
    method: 'post',
    data: data
  })
}

export function downloadArchiveBorrowTable(data) {
  return request({
    url: '/archive/archiveBorrow/downloadArchiveBorrowTable',
    method: 'post',
    data: data
  })
}

export function minusOne(data) {
  return request({
    url: '/archive/archiveBorrow/minusOne/'+data,
    method: 'post'
  })
}

export function minusOnePrint(data) {
  return request({
    url: '/archive/archiveBorrow/minusOnePrint/'+data,
    method: 'post'
  })
}

//打印次数
export function selectPrint(data) {
  return request({
    url: '/archive/archiveBorrow/selectPrint/'+data,
    method: 'GET'
  })
}

//催还按钮
export function cuiHuan(data) {
  return request({
    url: '/archive/archiveBorrowCar/cuiHuan/'+data.id,
    method: 'POST',
    data:{
      msg:data.msg
    }
  })
}

//评价
export function editCast(data) {
  return request({
    url: '/archive/archiveBorrow/editCast',
    method: 'PUT',
    data:data
  })
}

//领取
export function receiveBorrowId(borrowId) {
  return request({
    url: '/archive/archiveBorrow/receive/'+borrowId,
    method: 'POST',
  })
}

//借阅详情
export function getdetailBorrowID(borrowId) {
  return request({
    url: '/archive/archiveBorrow/getdetail/'+borrowId,
    method: 'POST',
  })
}



